﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CMP.ERP.Model;
using CMP.ERP.DAL;
using System.Data;
namespace CMP.ERP.BLL
{
    /// <summary>
    /// 用户登录/注册
    /// </summary>
    public class UsersBLL
    {
        UserDAL dal = new UserDAL();
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="name"></param>
        /// <param name="pwd"></param>
        /// <returns></returns>
        public bool GetShow(string name, string pwd)
        {
            return dal.GetShow(name, pwd);
        }
        /// <summary>
        /// 判断用户是否存在
        /// </summary>
        /// <param name="name"></param>
        /// <param name="pwd"></param>
        /// <returns></returns>
        public int GetShow1(string name)
        {
            return dal.GetShow1(name);
        }
        /// <summary>
        /// 注册
        /// </summary>
        /// <param name="uname"></param>
        /// <param name="upwd"></param>
        /// <returns></returns>
        public bool Getadd(Users u)
        {
            return dal.Getadd(u);
        }
        /// <summary>
        /// 显示
        /// </summary>
        /// <returns></returns>
        public DataTable ShowUsers()
        {
            return dal.ShowUsers();
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="UIds"></param>
        /// <returns></returns>
        public int DelUsers(int UIds)
        {
            return dal.DelUsers(UIds);
        }
        /// <summary>
        /// 根据编号查询用户信息
        /// </summary>
        /// <param name="UIds"></param>
        /// <returns></returns>
        public DataTable GetUsers(int UIds)
        {
            return dal.GetUsers(UIds);
        }
        /// <summary>
        /// 根据名称查询用户信息
        /// </summary>
        /// <param name="UName"></param>
        /// <returns></returns>
        public DataTable SelUsers(string UName)
        {
            return dal.SelUsers(UName);
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="u"></param>
        /// <returns></returns>
        public int UpdUsers(Users u)
        {
            return dal.UpdUsers(u);
        }
        public int StateUsers(Users u)
        {
            return dal.StateUsers(u);
        }
    }
}